﻿Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Windows.Forms
Imports Microsoft.Office.Interop
Imports System.IO




Public Class LatLong

    Private dataAdapter As New OleDbDataAdapter


    Private Sub LatLong_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    End Sub




    Function GetData(ByVal selectCommand As String)

        Try

            Dim ConCM As OleDb.OleDbConnection
            ConCM = New OleDb.OleDbConnection(My.Settings.M3Connect)
            ConCM.Open()

            Dim cmd As New OleDbCommand(selectCommand, ConCM)

            Me.dataAdapter = New OleDb.OleDbDataAdapter(cmd)
            Dim table As New DataTable
            table.Locale = System.Globalization.CultureInfo.InvariantCulture
            Me.dataAdapter.Fill(table)
            Me.BindingSource1.DataSource = table


            ' Resize the GridView columns to fit the newly loaded content.
            Me.GridView1.BestFitColumns()

        Catch ex As OleDbException

        End Try
        GetData = ""

    End Function






End Class